from flask import Flask
from .config import config
from .control import (create_blueprint, web_view, admin_view, extends_init)


def create_app(config_name):
    app = Flask(__name__)
    app.config.from_object(config[config_name])
    create_blueprint(app)
    extends_init(app)
    return app
